package com.yudongyang.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yudongyang.dao.UserMapper;
import com.yudongyang.domain.User;
import com.yudongyang.service.UserService;
@Service
public class UserServiceImpl implements UserService{

	@Resource
	private UserMapper userMapper;

	@Override
	public PageInfo<User> list(Integer pageNum, Integer pageSize) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum, pageSize);
		List<User> list = userMapper.list();
		return new PageInfo<User>(list);
	}

	@Override
	public int add(User u) {
		// TODO Auto-generated method stub
		return userMapper.add(u);
	}
	
}
